<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditClientTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditClientLabel_firstName}" for="firstName" />
                    <h:inputText id="firstName" value="#{clientController.selected.firstName}" title="#{bundle.EditClientTitle_firstName}" required="true" requiredMessage="#{bundle.EditClientRequiredMessage_firstName}"/>
                    <h:outputLabel value="#{bundle.EditClientLabel_lastName}" for="lastName" />
                    <h:inputText id="lastName" value="#{clientController.selected.lastName}" title="#{bundle.EditClientTitle_lastName}" required="true" requiredMessage="#{bundle.EditClientRequiredMessage_lastName}"/>
                    <h:outputLabel value="#{bundle.EditClientLabel_username}" for="username" />
                    <h:inputText id="username" value="#{clientController.selected.username}" title="#{bundle.EditClientTitle_username}" required="true" requiredMessage="#{bundle.EditClientRequiredMessage_username}"/>

                </h:panelGrid>
                <h:commandLink action="#{clientController.update}" value="#{bundle.EditClientSaveLink}"/>
                <br />
                <h:commandLink action="#{userController.prepareList()}" value="Change user details" immediate="true"/>
                <br /><br /><br />
                <h:commandLink action="View" value="#{bundle.EditClientViewLink}" immediate="true"/>
                <br />
                <h:commandLink action="#{clientController.prepareList}" value="#{bundle.EditClientShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.EditClientIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
